package apt.action;

import java.util.List;

import org.hibernate.HibernateException;

import apt.bean.DVDBean;
import apt.dao.DVDSDao;

import com.opensymphony.xwork2.ActionSupport;

public class HomeAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<DVDBean> listDvdBeans;
	private DVDSDao dvdsDao;
	
	public HomeAction() {
		dvdsDao = new DVDSDao();
	}

	public String execute() {
		try {
			listDvdBeans = dvdsDao.getListDVDS();

		} catch (HibernateException ex) {
			ex.printStackTrace();
			return ERROR;
		} catch (Exception e) {
			e.printStackTrace();
			return ERROR;
		}
		return SUCCESS;
	}

	public List<DVDBean> getListDvdBeans() {
		return listDvdBeans;
	}

	public void setListDvdBeans(List<DVDBean> listDvdBeans) {
		this.listDvdBeans = listDvdBeans;
	}

	
	
}
